//:  v.book.read.tip.facade.ComputerFacade.java
package v.book.read.tip.facade;

/* Complex parts */

class CPU {
    public void freeze() {  }
    public void jump(long position) {  }
    public void execute() {  }
}
 
class Memory {
    public void load(long position, byte[] data) {  }
}
 
class HardDrive {
    public byte[] read(long lba, int size) { return null; }
}
 
/* Facade */

class ComputerFacade {
    private CPU processor;
    private Memory ram;
    private HardDrive hd;
    
    private long BOOT_ADDRESS = 0x00;
    private long BOOT_SECTOR   = 0x01;
    private int   SECTOR_SIZE     = 0x02;
 
    public ComputerFacade() {
        this.processor = new CPU();
        this.ram = new Memory();
        this.hd = new HardDrive();
    }
 
    public void start() {
        processor.freeze();
        ram.load(BOOT_ADDRESS, hd.read(BOOT_SECTOR, SECTOR_SIZE));
        processor.jump(BOOT_ADDRESS);
        processor.execute();
    }
}
 
/* Client */
 
class You {
    public static void main(String[] args) {
        ComputerFacade computer = new ComputerFacade();
        computer.start();
    }
}
